function SrvTodo(params){ 
	 
}

SrvTodo.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new SrvTodo.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new SrvTodo.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new SrvTodo.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	
	
	/** 编号 [非空]       **/
	this.stId=function(stId){if(this.proxy)return this.getProxy().stId(stId);  this.put("stId", stId);return this;};
	/** and st_id is null */
	this.stIdNull=function(){if(this.proxy)return this.getProxy().stIdNull();if(this.get("stIdNot")==null)this.put("stIdNot", "");this.put("stId", null);return this;};
	/** not .... */
	this.stIdNot=function(){if(this.proxy)return this.getProxy().stIdNot();this.put("stIdNot", "not");return this;};
	this.stIdNotNull=function(){if(this.proxy)return this.getProxy().stIdNotNull();this.put("stIdNot", "not");this.put("stId", null);return this;};
	this.stIdNot=function(stId){if(this.proxy)return this.getProxy().stIdNot(stId);this.put("stIdNot", "not");this.put("stId", stId);return this;};
		
	/** and st_id <= ? */
	this.stIdMin=function(min){if(this.proxy)return this.getProxy().stIdMin(min);this.put("stIdMin", min);return this;};
	/** and st_id >= ? */
	this.stIdMax=function(max){if(this.proxy)return this.getProxy().stIdMax(max);this.put("stIdMax", max);return this;};
		
		
	this.stIdIn=function(ids){
		if(this.proxy)return this.getProxy().stIdIn(ids);  this.put("stIdIn", ids);return this;
	};	
		 
	
	
	/** 待办标题 [非空]       **/
	this.stTitle=function(stTitle){if(this.proxy)return this.getProxy().stTitle(stTitle);  this.put("stTitle", stTitle);return this;};
	/** and st_title is null */
	this.stTitleNull=function(){if(this.proxy)return this.getProxy().stTitleNull();if(this.get("stTitleNot")==null)this.put("stTitleNot", "");this.put("stTitle", null);return this;};
	/** not .... */
	this.stTitleNot=function(){if(this.proxy)return this.getProxy().stTitleNot();this.put("stTitleNot", "not");return this;};
	this.stTitleNotNull=function(){if(this.proxy)return this.getProxy().stTitleNotNull();this.put("stTitleNot", "not");this.put("stTitle", null);return this;};
	this.stTitleNot=function(stTitle){if(this.proxy)return this.getProxy().stTitleNot(stTitle);this.put("stTitleNot", "not");this.put("stTitle", stTitle);return this;};
		
		 
	
	
	/** 设定提醒时间        **/
	this.stAlarmTime=function(stAlarmTime){if(this.proxy)return this.getProxy().stAlarmTime(stAlarmTime);  this.put("stAlarmTime", stAlarmTime);return this;};
	/** and st_alarm_time is null */
	this.stAlarmTimeNull=function(){if(this.proxy)return this.getProxy().stAlarmTimeNull();if(this.get("stAlarmTimeNot")==null)this.put("stAlarmTimeNot", "");this.put("stAlarmTime", null);return this;};
	/** not .... */
	this.stAlarmTimeNot=function(){if(this.proxy)return this.getProxy().stAlarmTimeNot();this.put("stAlarmTimeNot", "not");return this;};
	this.stAlarmTimeNotNull=function(){if(this.proxy)return this.getProxy().stAlarmTimeNotNull();this.put("stAlarmTimeNot", "not");this.put("stAlarmTime", null);return this;};
	this.stAlarmTimeNot=function(stAlarmTime){if(this.proxy)return this.getProxy().stAlarmTimeNot(stAlarmTime);this.put("stAlarmTimeNot", "not");this.put("stAlarmTime", stAlarmTime);return this;};
		
	/** and st_alarm_time >= ? */
	this.stAlarmTimeStart=function(start){if(this.proxy)return this.getProxy().stAlarmTimeStart(start);this.put("stAlarmTimeStart", start);return this;};			
	/** and st_alarm_time <= ? */
	this.stAlarmTimeEnd=function(end){if(this.proxy)return this.getProxy().stAlarmTimeEnd(end);this.put("stAlarmTimeEnd", end);return this;};
		
		 
	
	
	/** 所属人员 [非空] [SrvUser]     /admin/permissions/user.query.do **/
	this.stUser=function(stUser){if(this.proxy)return this.getProxy().stUser(stUser);  this.put("stUser", stUser);return this;};
	/** and st_user is null */
	this.stUserNull=function(){if(this.proxy)return this.getProxy().stUserNull();if(this.get("stUserNot")==null)this.put("stUserNot", "");this.put("stUser", null);return this;};
	/** not .... */
	this.stUserNot=function(){if(this.proxy)return this.getProxy().stUserNot();this.put("stUserNot", "not");return this;};
	this.stUserNotNull=function(){if(this.proxy)return this.getProxy().stUserNotNull();this.put("stUserNot", "not");this.put("stUser", null);return this;};
	this.stUserNot=function(stUser){if(this.proxy)return this.getProxy().stUserNot(stUser);this.put("stUserNot", "not");this.put("stUser", stUser);return this;};
		
		
	this.stUserIn=function(ids){
		if(this.proxy)return this.getProxy().stUserIn(ids);  this.put("stUserIn", ids);return this;
	};	
		 
	
	
	/** 待办内容        **/
	this.stContent=function(stContent){if(this.proxy)return this.getProxy().stContent(stContent);  this.put("stContent", stContent);return this;};
	/** and st_content is null */
	this.stContentNull=function(){if(this.proxy)return this.getProxy().stContentNull();if(this.get("stContentNot")==null)this.put("stContentNot", "");this.put("stContent", null);return this;};
	/** not .... */
	this.stContentNot=function(){if(this.proxy)return this.getProxy().stContentNot();this.put("stContentNot", "not");return this;};
	this.stContentNotNull=function(){if(this.proxy)return this.getProxy().stContentNotNull();this.put("stContentNot", "not");this.put("stContent", null);return this;};
	this.stContentNot=function(stContent){if(this.proxy)return this.getProxy().stContentNot(stContent);this.put("stContentNot", "not");this.put("stContent", stContent);return this;};
		
		 
	
	
	/** 修改时间 [非空]       **/
	this.stUpdateTime=function(stUpdateTime){if(this.proxy)return this.getProxy().stUpdateTime(stUpdateTime);  this.put("stUpdateTime", stUpdateTime);return this;};
	/** and st_update_time is null */
	this.stUpdateTimeNull=function(){if(this.proxy)return this.getProxy().stUpdateTimeNull();if(this.get("stUpdateTimeNot")==null)this.put("stUpdateTimeNot", "");this.put("stUpdateTime", null);return this;};
	/** not .... */
	this.stUpdateTimeNot=function(){if(this.proxy)return this.getProxy().stUpdateTimeNot();this.put("stUpdateTimeNot", "not");return this;};
	this.stUpdateTimeNotNull=function(){if(this.proxy)return this.getProxy().stUpdateTimeNotNull();this.put("stUpdateTimeNot", "not");this.put("stUpdateTime", null);return this;};
	this.stUpdateTimeNot=function(stUpdateTime){if(this.proxy)return this.getProxy().stUpdateTimeNot(stUpdateTime);this.put("stUpdateTimeNot", "not");this.put("stUpdateTime", stUpdateTime);return this;};
		
	/** and st_update_time >= ? */
	this.stUpdateTimeStart=function(start){if(this.proxy)return this.getProxy().stUpdateTimeStart(start);this.put("stUpdateTimeStart", start);return this;};			
	/** and st_update_time <= ? */
	this.stUpdateTimeEnd=function(end){if(this.proxy)return this.getProxy().stUpdateTimeEnd(end);this.put("stUpdateTimeEnd", end);return this;};
		
		 
	
	
	/** 添加时间 [非空]       **/
	this.stAddTime=function(stAddTime){if(this.proxy)return this.getProxy().stAddTime(stAddTime);  this.put("stAddTime", stAddTime);return this;};
	/** and st_add_time is null */
	this.stAddTimeNull=function(){if(this.proxy)return this.getProxy().stAddTimeNull();if(this.get("stAddTimeNot")==null)this.put("stAddTimeNot", "");this.put("stAddTime", null);return this;};
	/** not .... */
	this.stAddTimeNot=function(){if(this.proxy)return this.getProxy().stAddTimeNot();this.put("stAddTimeNot", "not");return this;};
	this.stAddTimeNotNull=function(){if(this.proxy)return this.getProxy().stAddTimeNotNull();this.put("stAddTimeNot", "not");this.put("stAddTime", null);return this;};
	this.stAddTimeNot=function(stAddTime){if(this.proxy)return this.getProxy().stAddTimeNot(stAddTime);this.put("stAddTimeNot", "not");this.put("stAddTime", stAddTime);return this;};
		
	/** and st_add_time >= ? */
	this.stAddTimeStart=function(start){if(this.proxy)return this.getProxy().stAddTimeStart(start);this.put("stAddTimeStart", start);return this;};			
	/** and st_add_time <= ? */
	this.stAddTimeEnd=function(end){if(this.proxy)return this.getProxy().stAddTimeEnd(end);this.put("stAddTimeEnd", end);return this;};
		
		 
	
	
	/** 状态 [非空]   0:待处理 1:提醒报警 2:已完成     **/
	this.stStatus=function(stStatus){if(this.proxy)return this.getProxy().stStatus(stStatus);  this.put("stStatus", stStatus);return this;};
	/** and st_status is null */
	this.stStatusNull=function(){if(this.proxy)return this.getProxy().stStatusNull();if(this.get("stStatusNot")==null)this.put("stStatusNot", "");this.put("stStatus", null);return this;};
	/** not .... */
	this.stStatusNot=function(){if(this.proxy)return this.getProxy().stStatusNot();this.put("stStatusNot", "not");return this;};
	this.stStatusNotNull=function(){if(this.proxy)return this.getProxy().stStatusNotNull();this.put("stStatusNot", "not");this.put("stStatus", null);return this;};
	this.stStatusNot=function(stStatus){if(this.proxy)return this.getProxy().stStatusNot(stStatus);this.put("stStatusNot", "not");this.put("stStatus", stStatus);return this;};
		
		
	this.stStatusIn=function(ids){
		if(this.proxy)return this.getProxy().stStatusIn(ids);  this.put("stStatusIn", ids);return this;
	};	
		 
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有待办事项 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/systematic/todo.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取待办事项分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/systematic/todo.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取待办事项 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/systematic/todo.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

SrvTodo.get = function(id){
	var protocol = ux.ajax("/admin/systematic/todo.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.srvTodo;
	return null;
}

SrvTodo.where = new SrvTodo.Where(0,true);